home *** CD-ROM | disk | FTP | other *** search
/ Aminet 3 / Aminet 3 - July 1994.iso / Aminet / misc / unix / tracker_4_3.lzh / tracker / channel.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-13  |  4.0 KB  |  142 lines

  1. /* channel.h 
  2.     vi:se ts=3 sw=3:
  3.  */
  4.  
  5. /* $Id: channel.h,v 4.0 1994/01/11 17:43:33 espie Exp espie $
  6.  * $Log: channel.h,v $
  7.  * Revision 4.0  1994/01/11  17:43:33  espie
  8.  * Added prototypes.
  9.  *
  10.  * Revision 1.3  1994/01/05  14:54:09  Espie
  11.  * *** empty log message ***
  12.  *
  13.  * Revision 1.2  1994/01/05  01:59:14  Espie
  14.  * Added prototypes.
  15.  *
  16.  * Revision 1.1  1993/12/26  00:55:53  Espie
  17.  * Initial revision
  18.  *
  19.  * Revision 3.9  1993/11/17  15:31:16  espie
  20.  * audio_channel private.
  21.  *
  22.  * Revision 3.8  1993/11/11  20:00:03  espie
  23.  * Amiga support.
  24.  *
  25.  * Revision 3.7  1993/07/18  10:39:44  espie
  26.  * Cleaned up.
  27.  *
  28.  * Revision 3.6  1993/05/19  11:26:39  espie
  29.  * *** empty log message ***
  30.  *
  31.  * Revision 3.5  1992/11/27  10:29:00  espie
  32.  * General cleanup
  33.  *
  34.  * Revision 3.4  1992/11/23  10:12:23  espie
  35.  * *** empty log message ***
  36.  *
  37.  * Revision 3.3  1992/11/22  17:20:01  espie
  38.  * Simplified delay_pattern.
  39.  *
  40.  * Revision 3.2  1992/11/20  14:53:32  espie
  41.  * Added finetune.
  42.  *
  43.  * Revision 3.1  1992/11/19  20:44:47  espie
  44.  * Protracker commands.
  45.  *
  46.  * Revision 3.0  1992/11/18  16:08:05  espie
  47.  * New release.
  48.  *
  49.  * Revision 2.7  1992/11/13  13:24:24  espie
  50.  * Added parameters for extended Retriger command.
  51.  * Added transpose feature.
  52.  * Structured part of the code, especially replay ``automaton''
  53.  * and setting up of effects.
  54.  *
  55.  * Revision 1.5  1991/11/16  16:54:19  espie
  56.  * Bug correction: when doing arpeggio, there might not
  57.  * be a new note, so we have to save the old note value
  58.  * and do the arppeggio on that note.
  59.  * Added fields for arpeggio.
  60.  */
  61.  
  62.      
  63. #ifndef NUMBER_PATTERNS
  64. #define NUMBER_PATTERNS 128
  65. #endif
  66.  
  67. #define MAX_ARP 3
  68.      
  69. /* there is no note in each channel initially.
  70.  * This is defensive programming, because some
  71.  * commands rely on the previous note. Checking
  72.  * that there was no previous note is a way to
  73.  * detect faulty modules.
  74.  */
  75. #define NO_NOTE 255
  76.  
  77. struct channel
  78.    {
  79.    struct sample_info *samp;
  80.    struct audio_channel *audio;
  81.    int finetune;
  82.    int volume;             /* current volume of the sample (0-64) */
  83.    int pitch;              /* current pitch of the sample */
  84.    int note;               /* we have to save the note cause */
  85.                            /* we can do an arpeggio without a new note */
  86.     
  87.    int arp[MAX_ARP];       /* the three pitch values for an arpeggio */
  88.    int arpindex;           /* an index to know which note the arpeggio is doing */
  89.  
  90.    int viboffset;          /* current offset for vibrato (if any) */
  91.    int vibdepth;           /* depth of vibrato (if any) */
  92.  
  93.    int slide;              /* step size of pitch slide */
  94.  
  95.    int pitchgoal;          /* pitch to slide to */
  96.    int pitchrate;          /* step rate for portamento */
  97.  
  98.    int volumerate;         /* step rate for volume slide */
  99.  
  100.    int vibrate;            /* step rate for vibrato */
  101.  
  102.    int retrig;             /* delay for extended retrig command */
  103.    int current;
  104.                            /* current command to adjust parameters */
  105.    void (*adjust) P((struct channel *ch));
  106.    };
  107.  
  108. #define DO_NOTHING 0 
  109. #define SET_SPEED 1
  110. #define SET_SKIP 2
  111. #define SET_FASTSKIP 4
  112. #define SET_FINESPEED 32
  113.  
  114. #define JUMP_PATTERN 8
  115. #define DELAY_PATTERN 16
  116.  
  117. #define NORMAL_SPEED 6
  118. #define NORMAL_FINESPEED 125
  119.  
  120. struct automaton
  121.    {
  122.    int pattern_num;           /* the pattern in the song */
  123.    int note_num;              /* the note in the pattern */
  124.    struct block *pattern;     /* the physical pattern */
  125.    struct song_info *info;    /* we need the song_info */
  126.  
  127.    char gonethrough[NUMBER_PATTERNS + 1];  /* to check for repeats */
  128.  
  129.    int counter;               /* the fine position inside the effect */
  130.    int speed;                 /* the `speed', number of effect repeats */
  131.    int finespeed;             /* the finespeed, base is 100 */
  132.  
  133.    int do_stuff;              /* keeping some stuff to do */
  134.                               /* ... and parameters for it: */
  135.    int new_speed, new_note, new_pattern, new_finespeed;
  136.  
  137.    int pitch, note, para;     /* some extra parameters effects need */
  138.  
  139.    int loop_note_num, loop_counter;
  140.                               /* for command E6 */
  141.    };
  142.